package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.widget.TextView;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.bean.SaveCollectionBean;

/**
 * Created by K on 2018/9/11.
 * des:
 */
public class EmergencySaveCollectionListAdapter extends BaseQuickAdapter<SaveCollectionBean> {
    public EmergencySaveCollectionListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_save_collection_list;
    }

    @Override
    protected void convert(BaseViewHolder holder, SaveCollectionBean item) {
        TextView tv_num = holder.getView(R.id.tv_num);
        holder.setText(R.id.tv_num, (holder.getLayoutPosition() + 1) + "");
        holder.setText(R.id.tv_orgName, item.getOrgName());
        holder.setText(R.id.tv_jcScore, item.getJcScore() + "分");
        holder.setText(R.id.tv_nzScore, item.getNzScore() + "分");
        holder.setText(R.id.tv_nmScore, item.getNmScore() + "分");
        holder.setText(R.id.tv_avgScore, item.getAvgScore() + "分");
        if (holder.getPosition() > 2) {
            tv_num.setBackgroundResource(R.drawable.shape_blue);
        } else {
            tv_num.setBackgroundResource(R.drawable.shape_red);
        }
//        holder.getView(R.id.tv_details).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                mContext.startActivity(new Intent(mContext, EmergencyDrill3Activity.class));
//            }
//        });
    }
}
